#define  _CRT_SECURE_NO_WARNINGS 1

#include <windows.h>
#include <stdio.h>
#include<time.h> 
char* gettime() {
    time_t t;
    struct tm* local_time;
    time(&t);
    local_time = localtime(&t);
    return asctime(local_time);
}
DWORD WINAPI ThreadFunc1(LPVOID lpParam) {
    while (true) {
        printf("Those output come from Child_Process_Thread 1, %s\n", gettime());
        Sleep(2000);
    }
    return 0;
}

DWORD WINAPI ThreadFunc2(LPVOID lpParam) {
    while (true) {
        printf("Those output come from Child_Process_Thread 2, %s\n", gettime());
        Sleep(2000);
    }
    return 0;
}

int main() {
    HANDLE hThread1, hThread2;

    hThread1 = CreateThread(NULL, 0, ThreadFunc1, NULL, 0, NULL);
    hThread2 = CreateThread(NULL, 0, ThreadFunc2, NULL, 0, NULL);

    if (hThread1 == NULL || hThread2 == NULL) {
        printf("Failed to create threads\n");
        return 1;
    }

    WaitForSingleObject(hThread1, INFINITE);
    WaitForSingleObject(hThread2, INFINITE);

    CloseHandle(hThread1);
    CloseHandle(hThread2);

    return 0;
}
